import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  },{
      path:'/attend',
      name:'attend',
      component: ()=>import('../views/Attendance.vue')
  },{
       path:'/layout',
       name:'layout',
       component: ()=>import('../views/layout/Index.vue'),
        children:[
            {
                path:'attend',
                name:'attend',
                component:()=>import('../views/Attendance')
            },{
                path:'about',
                name:'about',
                component:()=>import('../views/AboutView')
            }
        ]
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
